package com.ruibang.glass.produce.constant;

/**
 * @author 宋锦康
 */
public enum ProduceErrorCode {

    PARAM_ERROR(100030001, "参数错误"),
    PARAM_IS_EMPTY(100030002, "参数为空"),
    DEVICE_ENTITY_IS_EMPTY(100030003, "设备信息为空"),
    ADD_DEVICE_ENTITY_FAIL(100030004, "新增设备失败"),
    QUERY_DEVICE_IS_FAIL(100030005, "查询设备信息失败"),
    QUERY_GATEWAY_IS_FAIL(100030006, "查询网关信息失败"),
    QUERY_VIDEO_IS_FAIL(100030007, "查询视频信息失败"),
    QUERY_NOTICE_IS_FAIL(100030008, "查询通知公告信息失败"),
    QUERY_MY_CONCERN_DEVICE_FAIL(100030009, "查询我关注的设备失败"),
    GET_RULE_ID_FAIL(100030010, "获取规则Id失败"),
    RULE_QUOTE_IS_CHANGE(100030011, "设备规则引用已改变,请重新设置规则!"),
    ALARM_QUOTE_IS_CHANGE(100030012, "报警推送引用已改变,请重新设置规则!"),
    GET_ALARM_ID_FAIL(100030013, "获取报警推送Id失败"),
    QUERY_DEVICE_MONITOR_ALARM_IS_FAIL(100030014, "查询设备监测报警信息失败"),
    GET_MONITOR_POINT_ID_FAIL(100030015, "获取监测点ID失败!"),
    QUERY_HOMEPAGE_DEVICE_MONITOR_FAIL(100030016, "获取首页设备监测信息失败!"),
    QUERY_EXAMINE_REPORT_IS_FAILED(100030017, "获取点检报告信息失败!"),
    INSERT_ERROR(100030018, "新增数据不成功"),
    UPDATE_ERROR(100030019, "修改数据不成功"),
    DELETE_ERROR(100030020, "删除数据不成功"),
    SELECT_ERROR(100030021, "查询数据不成功"),
    SEND_NOTE_IS_FAILED(100030022, "发送报警短信失败!"),
    PUSH_USER_INFO_IS_NULL(100030023, "最少需要配置一个推送用户"),
    QUERY_TARGET_IS_NULL(100030024, "查询目标为空"),
    MONITOR_DATA_EXPORT_FAIL(100030025, "数据导出失败！"),
    APPLY_ITEM_IS_NULL(100030026, "申请物品不可为空！"),
    BUSINESS_MENU_IS_EMPTY(100030027, "业务菜单ID不能为空"),
    MONITOR_POINT_IS_EXIST(100030028, "当前设备下还有点位存在，不可删除设备！"),
    UNKNOWN_TREND_CHART_TYPE(100030029,"未知趋势图类型！"),
    DEFECT_TYPE_IS_NULL(100030030,"缺陷类型不可为空"),
    APPLY_ITEM_IS_ZERO(100030031,"领用数量 > 0"),
    RAW_MATERIAL_RECEIVE_START_PROCESS_FAIL(100030032,"原材料领料流程发起失败"),
    SAME_MATERIAL_APPLY_FAIL(100030033,"不可有重复物料！"),
    UNKNOWN_DEFECT_TYPE(100030034,"未知缺陷类型！"),
    NOT_FOUND_YCL_MATERIAL_INFO(100030035,"未找到原材料物料信息，请检查物料或库存！"),
    APPLY_ITEM_IS_NULL_NO_START_PROCESS(100030036,"申请物品不可为空,无法发起流程！"),
    NEW_STATUS_CANNOT_BE_DELETE(100030037,"当前不是新建状态，不可删除记录！"),
    GET_COLD1_DISPATCH_DATA_FAIL(100030038,"获取冷端1调度数据失败，请联系管理员！");


    private int code;
    private String msg;

    ProduceErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }

    public static String getValue(int code) {
        for (ProduceErrorCode ele : values()) {
            if (ele.getCode() == code) {
                return ele.getMsg();
            }
        }
        return null;
    }

}
